package com.code.day17JiHe;

import java.util.ArrayList;
import java.util.stream.Stream;

public class TestStream {

    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("孙悟空");
        list.add("猪八戒");
        list.add("唐僧");
        list.add("白骨精");
        list.add("牛魔王");
        list.add("白骨精");
        list.add("沙悟净");

        Stream<String> stream = list.stream();
        stream.filter(x -> x.startsWith("")).filter(x -> x.length() == 2).forEach(System.out::println);

    }


}
